How to improve naive Bayes multiclass classification accuracy?
If you are hand-coding, and found that you got the same prediction for everything in your test set, it is possible that you are multiplying feature probabilities until you hit the floating point limitations of your environment, ending up with a zero value, which probably matches one of your labels. 

e.g., $0.001 * 0.0001 * 0.0002 * 0.0003 ... = 0$

Try adding log values instead.

e.g., $log(0.001) + log(0.0001) + log(0.0002) ... $