Fix for Issue #20 v2

An improved version of my last fix sa Issue #20. Hopefully oK na ito.