Add NPE Checks

Throw an IllegalArgumentException instead. An NPE is misleading in this case.