Added more descriptive error handling
Added detection of empty templates and fixed fatal bug when they were empty
Fixed bug that prevented proper formatting on malformed command