Cleanup, style tweaks, small bug fixes