Improve placement control (issue #202, fix and test)

Hi! Please consider this code as a solution to #202. Thanks!