Added config within constructor, error reporting, and fixed indentation