added maximsize parameter and fixed magpis tests and error reporting