Fixing a Bug

Please take a look to this bug fix.