diff --git a/src/p_enemy.c b/src/p_enemy.c
index 594d8f978876a8626dcda472d563ae0df0d90d71..e6ca4f2f159d4b9678ae25cf8211096e47bf62e8 100644
--- a/src/p_enemy.c
+++ b/src/p_enemy.c
@@ -13820,7 +13820,8 @@ void A_FallingLavaCheck(mobj_t *actor)
 	{
 		actor->flags = MF_NOGRAVITY|MF_NOCLIPTHING;
 		actor->momz = 0;
-		actor->z = actor->watertop;
+		if (actor->eflags & MFE_TOUCHWATER)
+			actor->z = (actor->eflags & MFE_VERTICALFLIP) ? actor->waterbottom : actor->watertop;
 		P_SetMobjState(actor, actor->info->deathstate);
 	}
 }
diff --git a/src/p_mobj.c b/src/p_mobj.c
index f4fe43ecf536da7e278dc859597c728935ec256b..5bf4323c344ab149d604ee37ab7ccdbf74931929 100644
--- a/src/p_mobj.c
+++ b/src/p_mobj.c
@@ -9096,13 +9096,11 @@ void P_MobjThinker(mobj_t *mobj)
 
 					if (hdist < 1000*FRACUNIT)
 					{
-						fixed_t dist = P_AproxDistance(hdist, mobj->target->z - mobj->z);
+						//Aim for player z position. If too close to floor/ceiling, aim just above/below them.
+						fixed_t destz = min(max(mobj->target->z, mobj->target->floorz + 70*FRACUNIT), mobj->target->ceilingz - 80*FRACUNIT - mobj->height);
+						fixed_t dist = P_AproxDistance(hdist, destz - mobj->z);
 						P_InstaThrust(mobj, R_PointToAngle2(mobj->x, mobj->y, mobj->target->x, mobj->target->y), 2*FRACUNIT);
-						//aim for player z position; if too close to floor, aim just above them
-						if (mobj->z - mobj->floorz >= 80*FRACUNIT)
-							mobj->momz = FixedMul(FixedDiv(mobj->target->z - mobj->z, dist), 2*FRACUNIT);
-						else
-							mobj->momz = FixedMul(FixedDiv((mobj->target->z + 70*FRACUNIT) - mobj->z, dist), 2*FRACUNIT);
+						mobj->momz = FixedMul(FixedDiv(destz - mobj->z, dist), 2*FRACUNIT);
 					}
 					else
 					{
@@ -9155,7 +9153,7 @@ void P_MobjThinker(mobj_t *mobj)
 						}
 
 						vdist = mobj->z - mobj->target->z - mobj->target->height;
-						if (vdist <= 0)
+						if (P_MobjFlip(mobj)*vdist <= 0)
 						{
 							P_SetTarget(&mobj->target, NULL);
 							break;