Fix bugs in markers functions.