Fixed error with retrieving last build for branch