Ah...I will always use brains before asking stupid questions. I will always use brains before asking stupid questions.
I seriously doubt that someone will do such a dumb mistake as I did again, but just in case.
After changing second function declaration to:
public db_check_name_exists(id,name[])
things started to work as expected.