Fixed #289

Credit goes to @pandamouse