Changed a few things in main

Added type-checking.