Throw an error if size > maximum possible

With passing tests