small bugs fixes, formatting