Removed unnecessary parts and fixed some problems. Also allowed some
graceful error messages to be displayed.