Small bug fixes, and a few feature additions.