Fix for issue #5. 

@r0man @melvinzhang This might be a possible fix for issue #5. Melvin did all the research on this one, I've just implemented a fix based on his findings.