minor bug fixes/cleaning