Fixing Bug 578. Thanks to Angelos <filiatra@gmail.com>