Identation and bug fixes