Error refactoring

Fixed up a few error issues and refactored out the Error type.