[peripherals] fixed a ambiguous variable and replaced .size() by .empty()

just some minors.
@opdenkamp ?