Cleaned up specializer code. Added error checking for valid backends