Bug fixes and code completion tests