Added error handling to constructor, fix assignment.