debug and style fixes