Added test for invalid global_limits.
Corrected some function signatures.
More tests for more coverage.