Add missing import.
Although @thatch45 hasn't finished his work, try to fix the logic in place.