fixed formatting and some warnings