Improve behaviour of collapsed code boxes