Eclipse warning fixes
Implement #22 as requested; added matching unit tests