Fixed some issues and added better arg handling