Miscellaneous tweaks and improvements