Minor fixes, utility functions