Implemented proper exceptions.
Removed locks.