Add more type guards