Cleanup commented code.
Add "Invalid argument" checks.