Use tabs consistently, add some initialization (do not know if it works).
Thanks Adriaan de Groot for the comments