small fixes in code block handling