More work on variables and bug fixes