Don't add nil as last request

A command could yield a valid request but also nil so we need to check
that otherwise nil will be added as next request blowing up everything
Merge pull request #104 from gabrielelana/issue-102

Don't add nil as last request