Indentation and bug fixes