Fixed errors, changed panic in main to halt