Added lock status variable, removed some compiler warnings.