Code imported from Assembla repo.