Fixed indentation and bugs.