tryLock, proper testing and small fixes