fix stupid mistake, fixes #17
optimize some more performance, fixes #16