Fixes and cleanup in elements_actions and layout