Should fix issues 17 and 18 (although I couldn't reproduce them).