Removed init cleanup and replaced with mexLock