Normalized indentation. Added some logging and useful return codes.