Better error handling, add sprintf, new options