Fix module (un-)loading dependencies

Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>