fixes #231 and #233
bug #231 follow up