Layout and error handling improvements