Implemented new functions and fixed bugs

Signed-off-by: Edwin Luijten <edwin.luijten@live.nl>