More bug fixes & style changes