added more tests

Fix bug in encode/decode to break q other than 32