Added error for undefined classes and output filename option