Fixed issue #15 properly this time