Fix for Collection crash + some mutex fixes

Please double check this as locking is generally dangerous :)