Fix for #59 as suggested by Tony Yan