Runtime: bug fixes