Change style of layout code and refrain from calling getters and setters directly, see issue #55