Fix 975

Fix for #975. Tested under ubuntu 12.04.