Add error checking and example directories