Check arguments and minor fixes