Port readings unstable


I have some unstable port readings from my digital ports and analog ports.
When reading from them the readings are randomly wrong.
For instance when I read the status from a button, once a while it returns the wrong value.

To solve it I have written a function that reads the port n times and if it is n times the same, the reading is accepted.

However, this is a cumbersome thing to do.
I noticed that was an issue one Month ago concerning sensors and that was solved.

GrovePi Sensors don’t work or analog sensors don’t work [SOLVED]

How can we know that this solution needs to be installed?
Will it also work for my problem?

Kind regards,

Hey Freddy,
Posted the steps to try out the newer firmware on the other post: http://www.dexterindustries.com/topic/instable-port-reading/#post-56207 .