Fixed errors and made some improvements.