Fixed old error, and cleaned up