fixed some types and added errors