fixing some warnings and an flock error