Further fix for issue #47

This fix should totally fix issue #47 while the previous fix (commit f816291cfdff324fcf9a3b13970412371b1f9f84) did not work right