Fixed several bugs in the frontend which caused segfaults.