Fix for #24 (Suggested by @swfideas)