some fixes and reformating