Substitute prototypes and shorten errors to reduce size of minified lib