changes related to #343 and #348