Fix for bug #312.
Merge pull request #379 from godarklight/master

Fix for bug #312.