Bug fixes & clean up