Some more error handling and other various maintenance related things