Code clean up, bug fixes, and query work.