Merge pull request #379 from godarklight/master

Fix for bug #312.