Throw exception instead of returning -1
Cleanup